package com.cykj.pos.service.impl;

import com.cykj.pos.profit.dto.MessageDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.cykj.pos.mapper.BizEarningsMapper;
import com.cykj.pos.domain.BizEarnings;
import com.cykj.pos.service.IBizEarningsService;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 商户收益Service业务层处理
 *
 * @author luo
 * @date 2021-03-24
 */
@Service
public class BizEarningsServiceImpl extends ServiceImpl<BizEarningsMapper, BizEarnings> implements IBizEarningsService {

    @Resource
    private BizEarningsMapper bizEarningsMapper;

    @Override
    public List<BizEarnings> queryEarningsList(MessageDTO messageDTO) {
        //处理一下分页
        Integer pageNo = messageDTO.getPageNo();
        Integer pageSize = messageDTO.getPageSize();
        if(pageNo!=null && pageNo!=-1 && pageSize!=null && pageSize!=-1){
            Integer start = (pageNo-1)*pageSize;
            messageDTO.setStart(start);
        }else{
            messageDTO.setStart(-1);
        }
        List<BizEarnings> list = bizEarningsMapper.queryEarningsList(messageDTO);
        return list;
    }
}
